using System;
using System.Collections;
using System.Xml.Serialization;

namespace AreaBuilder {
    public class Room {
        private ArrayList exitList = new ArrayList();
        private ArrayList extraList = new ArrayList();
        private int hpRegen = 100;
        private int manaRegen = 100;

        [XmlAttribute(AttributeName = "vnum")]
        public int VNum { get; set; }

        [XmlElement(ElementName = "title")]
        public String Title { get; set; }

        [XmlElement(ElementName = "description")]
        public String Description { get; set; }

        [XmlElement(ElementName = "xxValue")]
        public int XXValue { get; set; }

        [XmlElement(ElementName = "roomFlags")]
        public String RoomFlags { get; set; }

        [XmlElement(ElementName = "sectorFlags")]
        public String SectorFlags { get; set; }

        [XmlElement(ElementName = "manaRegen")]
        public int ManaRegen {
            get { return manaRegen; }
            set { manaRegen = value; }
        }

        [XmlElement(ElementName = "hpRegen")]
        public int HPRegen {
            get { return hpRegen; }
            set { hpRegen = value; }
        }

        [XmlArray("exits")]
        [XmlArrayItem("exit", typeof (RoomExit))]
        public ArrayList Exits {
            get { return exitList; }
            set { exitList = value; }
        }

        [XmlArray("extras")]
        [XmlArrayItem("extra", typeof (RoomExtra))]
        public ArrayList Extras {
            get { return extraList; }
            set { extraList = value; }
        }

        public void addExit(RoomExit re) {
            exitList.Add(re);

            //Console.WriteLine("Added exit: {0}", re.Direction);
        }

        public void addExtra(RoomExtra re) {
            extraList.Add(re);

            //Console.WriteLine("Added extra: {0}", re.Keyword);
        }
    }
}